package com.bdsoft.security.service.impl;

import cn.hutool.core.map.MapUtil;
import com.bdsoft.security.entity.OperationLogDTO;
import com.bdsoft.security.mapper.PermisstionMapper;
import com.bdsoft.security.service.ResourceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class PermisstionServiceImpl implements ResourceService {
    @Autowired
    private PermisstionMapper permisstionMapper;

    @Override
    public String getResourceIdByUrlAndMethod(String url, String method) {
        return permisstionMapper.getResourceIdByUrlAndMethod(url, method);
    }

    @Override
    public Map<String, Object> addLog(OperationLogDTO operationLogDTO) {
        permisstionMapper.InsertLog(operationLogDTO);
        return MapUtil.<String,Object>builder().put("message","成功").build();
    }
} 